<template>
	<view class="page">
		<view class="box-c">
			<view class="">
				<view  class="box list d-jc-sb d-ai-c" @tap="jumpto">
					<view class="">
						隐私条款
					</view>
					<image class="icon_arrow" src="https://xb-street.oss-cn-shanghai.aliyuncs.com/yl-school/static/right_arrow.png"></image>
				</view>
				<view class="line">
	
				</view>
			</view>
			
			<view class="">
				<view class="box list d-jc-sb d-ai-c" @tap="jumpto">
					<view class="">
						用户协议
					</view>
					<image class="icon_arrow" src="https://xb-street.oss-cn-shanghai.aliyuncs.com/yl-school/static/right_arrow.png"></image>
				</view>
				<view class="line">
	
				</view>
			</view>
		</view>
		<view v-if="loginState" class="loginout" @tap='bindLogin'>
			退出登录
		</view>
	
	
	
	
		<!-- <button type="default" @tap='bindLogin'>退出</button> -->
	
	
	
	</view>
	
</template>

<script>
	import {
		mapState,
		mapMutations
	} from 'vuex';
	export default {
		data() {
			return {
				
			}
		},
		computed: mapState(['loginState', 'userInfo']),
		methods: {
			jumpto(){
				uni.navigateTo({
					url:'server'
				})
			},
			...mapMutations(['logout', 'setUserInfo']),
			bindLogin() {
				let _this = this
				uni.showModal({ 
					title: '退出登录',
					content: '确认退出当前账号？',
					success: function(res) {
						if (res.confirm) {
							_this.logout()
							uni.navigateBack(1)
						} else if (res.cancel) {
							uni.showToast({
								title: '已取消',
								duration: 2000,
								icon: "none"
							})
						}
					}
				});
			
				// this.getUserInfo()
			},
		}
	}
</script>

<style lang="less" scoped>
	.box{
		display: flex;
		justify-content: space-between;
		align-items: center;
	}
.page {
		background-color: #F8F8F8;
		height: 100%;
	}

	.loginout {
		width: 85%;
		height: 88rpx;
		background-color: #FF5533;
		margin: 0 auto;
		line-height: 88rpx;
		text-align: center;
		color: #fff;
		font-size: 32rpx;
		border-radius: 50rpx;
		margin-top: 100rpx;
	}

	.iconqianjin {
		margin-left: 20rpx;
	}

	.list {
		padding: 0 20rpx;
		height: 100rpx;
		background-color: #FFFFFF;
		font-size: 30rpx;
		color: #333333FF;

		.right {
			color: #999999FF;
		}
	}

	.line {
		width: 100%;
		height: 4rpx;
		background-color: #F8F8F8;
	}
</style>
